import http from '@/utils/http'
/**
 * 查询请求体
 */
export interface QueryRequest {
    value?: string;
}

/** 系统字典类型 */
export interface DictResp {
    id: number
    name: string
    code: string
    sort: boolean
    note: string
    create_time?: number
    update_time?: number
    mark?: number
}
/**
 * 查询响应
 */
export interface QueryResponse extends DictResp {}

/**
 * 更新请求体
 */
export interface UpdateRequest {
    id?: number;
    sort?: number;
    name?: string;
    code?: string;
    note?: string;
}

/**
 * 查询列表
 */
export function getList(params: QueryRequest)  {
    return http.get<QueryResponse[]>('/admin/dict/index', params)
}

/**
 * 通过 id 新增更新数据
 */
export function updateRows(request: UpdateRequest) {
    return http.put('/admin/dict/edit', request);
}
/**
 * 通过 id 删除数据
 */
export function deleteRows(id: number) {
    return http.post('/admin/dict/delete', { id })
}


